package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.auth.AuthBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.AuthOperateService;
import com.zhuss.core.auth.AuthServiceExt;
import com.zhuss.exception.AabException;


/**
 * 用户的权限 controller
 * @Author zhushanshuo
   @Date 2019-12-27 19:58
 *
 */
  
 
@RestController
@RequestMapping("/auth")
public class AuthController extends BaseController {
	
	@Autowired
	@Qualifier("authService")
	private AuthOperateService<Object, Object> authService;
	
	@Autowired
	@Qualifier("authServiceExt")
	private AuthServiceExt authServiceExt;
	
	
	/**
	 * 查询 用户菜单
	 * @param bo
	 * @throws AabException
	 */
	@ResponseBody
    @PostMapping("/menu")
    public Object menu(@RequestBody AuthBo bo) throws AabException {
		
		Object result = authService.menu(bo);
		return result;
    }
	
	/**
	 * 查询 用户菜单树
	 * @param bo
	 * @throws AabException
	 */
	@ResponseBody
	@PostMapping("/menuTree")
	public Object menuTree(@RequestBody AuthBo bo) throws AabException {
		
		Object result = authService.menuTree(bo);
		return result;
	}
	
	
	/**
	 * 查询 用户接口
	 * @param bo
	 * @throws AabException
	 */
	@ResponseBody
    @PostMapping("/resource")
    public Object resource(@RequestBody AuthBo bo) throws AabException {
		
		Object result = authService.resource(bo);
		return result;
    }
	

	
}
